import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [{
  path: '/',
  redirect: '/login',
  component: () => import('@/views/Main'),
  children: [{
    path: '/home',
    name: 'home',
    component: () => import('@/views/Home/Home')
  },
  {
    path: '/safe',
    name: 'safe',
    component: () => import('../views/Safe/Safe')
  },
  {
    path: '/video',
    name: 'video',
    component: () => import('../views/VideoManage/Video')
  },
  {
    path: '/users',
    name: 'users',
    component: () => import('../views/User/Users')
  },
  {
    path: '/rights',
    name: 'rights',
    component: () => import('../views/Power/Rights')
  },
  {
    path: '/roles',
    name: 'roles',
    component: () => import('../views/Power/Roles')
  },
  {
    path: '/goods',
    name: 'goods',
    component: () => import('../views/Commodity/Goods')
  },
  {
    path: '/cates',
    name: 'cates',
    component: () => import('../views/Commodity/Cates')
  },
  {
    path: '/orders',
    name: 'orders',
    component: () => import('../views/Order/Orders')
  },
  {
    path: '/comment',
    name: 'comment',
    component: () => import('../views/Comment/Comment')
  },
  {
    path: '/operationrecord',
    name: 'operationrecord',
    component: () => import('../views/OperationRecord/operationRecord')
  }
  ]
},
{
  path: '/login',
  name: 'login',
  component: () => import('@/views/Login/Login')
}
]

const router = new VueRouter({
  routes
})

export default router
